from base.base1 import Base1
from appium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

class SearchPage(Base1):
    sousuo=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout[2]/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]')
    input=(By.ID,'com.kongfz.app:id/etContent')
    anniu='new UiSelector(resourceId["com.kongfz.app:id/tvSearch"])'
    book=(By.ID,'com.kongfz.app:id/ivPic')
    dy1=(By.ID,'com.kongfz.app:id/lavFavoriteGoods')

    def searchyewu(self,content):
        self.loc_ele(self.sousuo).click()
        sleep(3)
        self.loc_ele(self.input).send_keys(content)
        sleep(3)
        self.loc_ui_ele(self.anniu).click()
        sleep(3)
        self.loc_wait_ele(self.book).click()